﻿using SuporeSliplampApp.DataAccess;
using SuporeSliplampApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Animation;

namespace SuporeSliplampApp.Service
{
    public class AddUserService
    {
        SqlHelper sqlHelper = new SqlHelper();
        public bool AddUser(UserModel user)
        {
            return sqlHelper.SaveUser(user);
        }

        public bool UpdateUser(UserModel user)
        {
            return sqlHelper.UpdateUserPassword(user.UserName, user.Password ,user.IsAdmin);
        }

        public bool UserExist(string username)
        {
            return sqlHelper.UserExist(username);
        }

        public bool DeleteUser(UserModel user)
        {
            return sqlHelper.DeleteUser(user);
        }

        public List<UserModel> GetUsers()
        {
            return sqlHelper.GetAllUsers();
        }

    }
}
